/*
 *  AS IS License 
 * ==Naive Coders==
 */
package com.naivecoders.refex.functions;

import com.naivecoders.refex.FunctionFactory;

/**
 *
 * @author andrew
 */
public class IsEmptyFunction extends AbstractFunction {

    public IsEmptyFunction(FunctionFactory origin) {
        super(origin);
    }

    @Override
    public AbstractFunction evaluate(ListFunction x) throws InvocationException {
        if (listArg(x, 0).isEmpty()) {
            return getOrigin().trueFunction();
        }
        return this;
    }
}
